package com.hhss.qishi.entity.system;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.hhss.qishi.entity.common.BasePojo;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 用户实体
 * @author hhss
 * @date 2018年7月11日
 */
@Table(name = "sys_user")
@JsonIgnoreProperties(value = {"handler"})
public class User extends BasePojo{
	
	private static final long serialVersionUID = -3204354214146399559L;

	public User() {
	}

	public User(@NotEmpty String loginId) {
		this.loginId = loginId;
	}

	/**
	 * 登录名
	 */
	@NotEmpty
	@Column(name = "login_id")
	private String loginId;
	
	/**
	 * 密码
	 */
	@Column(name = "password")
	private String password;
	
	/**
	 * 名称
	 */
	@Column(name = "user_name")
	private String userName;
	
	/**
	 * 性别
	 */
	@NotEmpty
	@Column(name = "gender")
	private Integer gender;
	
	/**
	 * 邮箱
	 */
	@Column(name = "email")
	private String email;
	
	/**
	 * 邮箱
	 */
	@Column(name = "phone")
	private String phone;

	/**
	 * 盐值，MD5加密用
	 */
	@Column(name = "salt", updatable = false)
	private String salt;

	/**
	 * 备注
	 */
	@Column(name = "spec")
	private String spec;

	/**
	 * 存储 用户关联查询相关角色
	 */
	private List<Role> roles;
	
	/**
	 * @return the loginId
	 */
	public String getLoginId() {
		return loginId;
	}

	/**
	 * @param loginId the loginId to set
	 */
	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @param userName the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the phone
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * @param phone the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	/**
	 * @return the spec
	 */
	public String getSpec() {
		return spec;
	}

	/**
	 * @param spec the spec to set
	 */
	public void setSpec(String spec) {
		this.spec = spec;
	}

	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}